package com.xiaotu.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 上传文件存储实体
 * @作者 王艳龙
 * @日期 2021-01-29 11:42
 * @功能
 */
@Data
public class EnterpriseFileModel {

    public static final String TABLE_NAME = "tab_enterprise_file";

    //id
    private Integer id;
    //文件名称
    private String fileName;
    //文件类型 1.Word文档 2.图片 3.音频 4.视频 5.excel 99.其他
    private String fileType;
    //文件后缀
    private String suffix;
    //附件大小，单位为字节（k）
    private long size;
    //附件长度
    private long length;
    //文件存储路径
    private String storePath;
    //预览文件存储路径
    //private String previewStorePath;
    //企业id
    private String enterpriseId;
    //菜单id
    private String menuId;
    //申请id
    private String applyId;
    //附件文件tab项id
    private String fileTabId;
    //附件文件标题id
    private String fileTitleId;
    //创建时间
    @JsonFormat(timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime=new Date();

    public EnterpriseFileModel() {
    }

    public EnterpriseFileModel(String fileName, String fileType, String suffix, long size, long length,
                               String storePath, String enterpriseId, String menuId,
                               String applyId, String fileTabId, String fileTitleId) {
        this.fileName = fileName;
        this.fileType = fileType;
        this.suffix = suffix;
        this.size = size;
        this.length = length;
        this.storePath = storePath;
        this.enterpriseId = enterpriseId;
        this.menuId = menuId;
        this.applyId = applyId;
        this.fileTabId = fileTabId;
        this.fileTitleId = fileTitleId;
    }
}
